![]() |
YNQ
YNQ-1.6.0
|
Data Structures | |
| struct | CMResolverRegisteredMethodDescription |
Macros | |
| #define | NQ_RESOLVER_IPV4 4 |
| #define | NQ_RESOLVER_IPV6 6 |
| #define | NQ_RESOLVER_NONE 0 |
| #define | NQ_RESOLVER_DNS 1 |
| #define | NQ_RESOLVER_NETBIOS 2 |
| #define | NQ_RESOLVER_EXTERNAL_METHOD 5 |
| #define | NQ_RESOLVER_DNS_DC 8 |
| #define | NQ_RESOLVER_NETBIOS_DC 10 |
| #define | NQ_RESOLVER_WSD 12 |
Typedefs | |
| typedef NQ_INT(* | CMResolverNameToIpA )(const NQ_CHAR *name, void *ip, NQ_COUNT index) |
| typedef NQ_INT(* | CMResolverNameToIp )(const NQ_WCHAR *name, void *ip, NQ_COUNT index) |
| typedef NQ_BOOL(* | CMResolverIpToNameA )(NQ_CHAR *name, const void *ip, NQ_INT ipType) |
| typedef NQ_BOOL(* | CMResolverIpToName )(NQ_WCHAR *name, const void *ip, NQ_INT ipType) |
Functions | |
| void | cmResolverSetExternalA (CMResolverNameToIpA nameToIp, CMResolverIpToNameA ipToName) |
| void | cmResolverSetExternal (CMResolverNameToIp nameToIp, CMResolverIpToName ipToName) |
| const NQ_WCHAR * | cmResolverGetHostName (const NQ_IPADDRESS *ip) |
| const NQ_IPADDRESS * | cmResolverGetHostIps (const NQ_WCHAR *dnsList, const NQ_WCHAR *host, NQ_INT *numIps) |
| const NQ_WCHAR * | cmResolverGetDCName (const NQ_WCHAR *domain, const NQ_WCHAR *dnsList, NQ_INT *numDCs) |
| void | cmResolverEnableMethod (NQ_INT type, NQ_BOOL unicast, NQ_BOOL multicast) |
| NQ_BOOL | cmResolverRegisterExternalMethod (const CMResolverRegisteredMethodDescription *pMethod) |
| NQ_BOOL | cmResolverUpdateExternalMethodsPriority (NQ_INT requiredPriority) |
| #define NQ_RESOLVER_IPV4 4 |
The resolved address is IPV4.
| #define NQ_RESOLVER_IPV6 6 |
The resolved address is IPV6.
| #define NQ_RESOLVER_NONE 0 |
No address resolved. This value designates a resolution failure.
| #define NQ_RESOLVER_DNS 1 |
Mechanism type is DNS.
| #define NQ_RESOLVER_NETBIOS 2 |
Mechanism type is NetBIOS.
| #define NQ_RESOLVER_EXTERNAL_METHOD 5 |
Mechanism type not known, external method set by the user.
| #define NQ_RESOLVER_DNS_DC 8 |
Mechanism type is DNS DC.
| #define NQ_RESOLVER_NETBIOS_DC 10 |
Mechanism type is NetBIOS DC.
| #define NQ_RESOLVER_WSD 12 |
Mechanism type is WS-Discovery.
This function prototype designates a callback for resolving host IP address by its name. NQ uses this callback for external resolution.
| name | The name of the host to resolve. |
| index | Index of the resolved IP address. External resolver may resolve multiple IP addresses for the same name. When external resolution is required, NQ subsequently calls this function with 'index' values incrementing, starting from zero. External resolver should return the appropriate IP address or it should should fail the call when an 'index' result is not available. |
This function prototype designates a callback for resolving host IP address by its name. NQ uses this callback for external resolution.
| name | The name of the host to resolve. |
| index | Index of the resolved IP address. External resolver may resolve multiple IP addresses for the same name. When external resolution is required, NQ subsequently calls this function with 'index' values incrementing, starting from zero. External resolver should return the appropriate IP address or it should should fail the call when an 'index' result is not available. |
This function prototype designates a callback for resolving host name by its IP address. NQ uses this callback for external resolution.
| name | Buffer for the resolved name. |
| ip | Pointer to IP address. This pointer designates either NQ_IPADDRESS4, NQ_IPADDRESS4 type or NQ_IPADDRESS6, NQ_IPADDRESS6 type depending on the 'type' argument below. |
| ipType | IP address type. This value can be either NQ_RESOLVER_IPV4 or NQ_RESOLVER_IPV6. It defines the format of the 'ip' argument. |
This function prototype designates a callback for resolving host name by its IP address. NQ uses this callback for external resolution.
| name | Buffer for the resolved name. |
| ip | Pointer to IP address. This pointer designates either NQ_IPADDRESS4, NQ_IPADDRESS4 type or NQ_IPADDRESS6, NQ_IPADDRESS6 type depending on the 'type' argument below. |
| ipType | IP address type. This value can be either NQ_RESOLVER_IPV4 or NQ_RESOLVER_IPV6. It defines the format of the 'ip' argument. |
| void cmResolverSetExternalA | ( | CMResolverNameToIpA | nameToIp, |
| CMResolverIpToNameA | ipToName | ||
| ) |
This function extends NQ's name-to-IP and IP-to-name resolver. NQ attempts to use its internal resolution methods first:
NQ uses callback pointers as follows:
| nameToIp | Pointer to a function that resolves host IP by its name. This function signature should conform to the CMResolverNameToIp prototype. This value can be NULL. In this case, NQ will fail external name-to-IP resolution. |
| ipToName | Pointer to a function that resolves host name by its IP. This function signature should conform to the CMResolverIpToName prototype. This value can be NULL. In this case, NQ will fail external IP-to-name resolution. |
| void cmResolverSetExternal | ( | CMResolverNameToIp | nameToIp, |
| CMResolverIpToName | ipToName | ||
| ) |
This function extends NQ's name-to-IP and IP-to-name resolver. NQ attempts to use its internal resolution methods first:
NQ uses callback pointers as follows:
| nameToIp | Pointer to a function that resolves host IP by its name. This function signature should conform to the CMResolverNameToIp prototype. This value can be NULL. In this case, NQ will fail external name-to-IP resolution. |
| ipToName | Pointer to a function that resolves host name by its IP. This function signature should conform to the CMResolverIpToName prototype. This value can be NULL. In this case, NQ will fail external IP-to-name resolution. |
| const NQ_WCHAR* cmResolverGetHostName | ( | const NQ_IPADDRESS * | ip | ) |
This function resolves host by its IP and return its name.
Host name is created in allocated memory so that it is caller's responsibility to free this memory.
NQ uses several unicast and multicast methods for this resolution. First, it attempts all unicast methods concurrently. Depending on compilation parameters those methods may be:
| ip | Pointer to host IP address. |
| const NQ_IPADDRESS* cmResolverGetHostIps | ( | const NQ_WCHAR * | dnsList, |
| const NQ_WCHAR * | host, | ||
| NQ_INT * | numIps | ||
| ) |
This function resolves host by its name and return its IP addresses.
The array of IP addresses is created in allocated memory so that it is caller's responsibility to free this memory.
NQ uses several unicast and multicast methods for this resolution. First, it attempts all unicast methods concurrently. Depending on compilation parameters those methods may be:
| host | Pointer to host name to resolve. |
| numIps | Pointer to variable that on exit gets the number of resolved IP addresses. |
| dnsList | DNS ips to register and prepare methods. |
| const NQ_WCHAR* cmResolverGetDCName | ( | const NQ_WCHAR * | domain, |
| const NQ_WCHAR * | dnsList, | ||
| NQ_INT * | numDCs | ||
| ) |
This function resolves domain's DC and return its name.
DC name is created in allocated memory so that it is caller's responsibility to free this memory.
NQ uses several unicast and multicast methods for this resolution. First, it attempts all unicast methods concurrently. Depending on compilation parameters those methods may be:
| domain | Pointer to domain name. |
| dnsList | Semicolon delimited list of DNS servers. |
| numDCs | Pointer to variable that on exit gets the number of resolved DC names. |
Resolver uses different methods (mechanisms) to resolve host IP(s) by name or to resolve host name by IP. Each mechanism may use either unicasts or multicasts. NQ attempts all possible unicasts first. Then, if unicasts failed, it attempts multicasts. Currently, the following mechanisms are available:
| Method | DNS | NetBIOS |
|---|---|---|
| Unicast | DNS server query | WINS query |
| Multicast | LLMNR | local broadcast |
All methods are initially enabled on NQ startup. This function allows to enable or disable a particular one in run-time.
| type | Resolution type. This may be one of the following: NQ_RESOLVER_DNS, NQ_RESOLVER_NETBIOS, NQ_RESOLVER_EXTERNAL_METHOD, NQ_RESOLVER_DNS_DC, NQ_RESOLVER_NETBIOS_DC, NQ_RESOLVER_WSD. |
| unicast | When this parameter is TRUE, NQ enables unicast method (s) of the given type. When this parameter is FALSE., NQ disables unicast method(s). |
| multicast | When this parameter is TRUE, NQ enables multicast method(s) of the given type. When this parameter is FALSE., NQ disables multicast method(s). |
| NQ_BOOL cmResolverRegisterExternalMethod | ( | const CMResolverRegisteredMethodDescription * | pMethod | ) |
Resolver uses DNS and NET BIOS to resolve host IP(s) by name or to resolve host name by IP. This function enables adding another resolution method. A method is defined using the CMResolverRegisteredMethodDescription Structure. See structure description with different members. Not all functions have to be defined, but notice following guidelines:
| pMethod | resolution method. |
This function enables run time control on the order of resolver methods execution. In resolver point of view three groups of methods exist: unicast methods, multicast methods, external methods. External methods are all methods that were registered by the user. Each group of methods is executed separately and if no reply is received the next group is executed.
| requiredPriority | This parameter takes the following values:
|